<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        let user={
            name:"唐玮",
            age:22
        };
        Object.freeze(user);
        console.log(JSON.stringify(Object.getOwnPropertyDescriptors(user),null,2));
//         {
//   "name": {
//     "value": "唐玮",
//     "writable": false, //变了
//     "enumerable": true,
//     "configurable": false//变了
//   },
//   "age": {
//     "value": 22,
//     "writable": false,
//     "enumerable": true,
//     "configurable": false
//   }
// }

//不能改属性的值，不能删除，不能添加

console.log(Object.isFrozen());//true
    
    </script>
</body>
</html>